<div id="storepurchaseapplyAuditPage" v-cloak>
    <el-dialog title="" :visible.sync="purchaseapplyAuditPageVisible" fullscreen>
        <el-row>
            <el-card class="box-card">
                <div slot="header" class="clearfix">
                    <span>采购耗材申请审核</span>
                </div>
                <div class="text item">
                    <div class="row" style="line-height:30px;font-size: 12px;">
                        <div class="col-md-2">
                            <div class="col-md-6 text-right">采购申请单号：</div>
                            <div class="col-md-6">{{purchaseApplyForm.storePurchaseApplyEntity.applyNo}}</div>
                        </div>
                        <div class="col-md-2">
                            <div class="col-md-5 text-right">申请门店 ：</div>
                            <div class="col-md-7">{{purchaseApplyForm.storePurchaseApplyEntity.sellerName}}</div>
                        </div>
                        <div class="col-md-2">
                            <div class="col-md-6 text-right">申请人 ：</div>
                            <div class="col-md-6">{{purchaseApplyForm.storePurchaseApplyEntity.createName}}</div>
                        </div>
                        <div class="col-md-2">
                            <div class="col-md-5 text-right">申请时间 ：</div>
                            <div class="col-md-7">{{purchaseApplyForm.storePurchaseApplyEntity.createTime}}</div>
                        </div>
                        <div class="col-md-4">
                            <div class="col-md-4 text-right">申请备注 ：</div>
                            <div class="col-md-8">{{purchaseApplyForm.storePurchaseApplyEntity.applyRemark}}</div>
                        </div>
                    </div>
                </div>
            </el-card>
        </el-row>
        <!-- 采购耗材信息 start -->
        <el-row>
            <el-card class="box-card">
                <div class="text item">
                    <el-form ref="form" :model="purchaseApplyForm" label-width="80px" size="mini">
                        <el-table border stripe ref="multipleTable" :data="purchaseApplyForm.storePurchaseApplyDetailEntityList" style="margin-bottom: 20px;"
                                  tooltip-effect="dark" size="mini">
                            <el-table-column type="index" width="60" label="序号" align="center"> </el-table-column>
                            <el-table-column prop="materialId" label="耗材ID" width="80" align="center"></el-table-column>
                            <el-table-column prop="materialName" label="耗材名称" align="center" show-overflow-tooltip></el-table-column>
                            <el-table-column prop="specifications" label="规格" width="200" align="center"></el-table-column>
                            <el-table-column prop="materialModel" label="型号" width="200" align="center"></el-table-column>
                            <el-table-column prop="unit" label="单位" width="100" v-if="false" :formatter="formatUnit" align="center"></el-table-column>
                            <el-table-column prop="showUnit" label="单位" width="100"  align="center"></el-table-column>
                            <el-table-column  prop="materialQuantity" label="数量" width="100" align="center"></el-table-column>
                            <el-table-column  prop="length" label="长" width="100" align="center"></el-table-column>
                            <el-table-column  prop="width" label="宽" width="100" align="center"></el-table-column>
                            <el-table-column  prop="materialWeight" label="克重" width="100" align="center"></el-table-column>
                            <el-table-column prop="unitMoney" label="单价" width="100" align="center"></el-table-column>
                            <el-table-column label="总价" width="200" align="center">
                                <template slot-scope="scope">
                                    <el-input type="number"
                                              v-model="scope.row.totalMoney"
                                              size="mini"
                                              min="0"
                                              max="100000"
                                              @change="totalMoneyChange(scope.row,scope.$index)">
                                    </el-input>
                                </template>
                            </el-table-column>
                            <el-table-column label="采购商" width="260" header-align="center">
                                <template slot-scope="scope">
                                    <el-select v-model="scope.row.supplierId" filterable placeholder="请选择" size="mini">
                                        <el-option
                                                v-for="item in e.materialSupplier"
                                                :key="item.msId"
                                                :label="item.msName"
                                                :value="item.msId">
                                        </el-option>
                                    </el-select>
                                </template>
                            </el-table-column>
                        </el-table>
                        <el-col :span="12">
                            <el-form-item label="采购总金额：" size="mini" label-width="120px">
                                <el-input v-model="purchaseApplyForm.storePurchaseApplyEntity.totalMoney" readonly="true"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="是否含税：" size="mini" label-width="120px" :span="12">
                                <el-select v-model="purchaseApplyForm.storePurchaseApplyEntity.tax" filterable placeholder="请选择" size="mini">
                                    <el-option
                                            v-for="item in e.taxEnum"
                                            :key="item.value"
                                            :label="item.label"
                                            :value="item.value">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col>
                            <el-form-item label="审核备注:" size="mini" label-width="120px">
                                <el-input type="textarea" v-model="purchaseApplyForm.storePurchaseApplyEntity.auditRemark"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col class="text-center">
                            <el-form-item>
                                <el-button v-if="purchaseApplyForm.storePurchaseApplyEntity.status == 1" type="primary" @click="onSubmit">审核通过</el-button>
                                <el-button v-if="purchaseApplyForm.storePurchaseApplyEntity.status == 1" type="warning" @click="reject">驳&nbsp;&nbsp;回</el-button>
                                <el-button @click="purchaseapplyAuditPageVisible = false">返&nbsp;&nbsp;回</el-button>
                            </el-form-item>
                        </el-col>
                    </el-form>
                </div>
            </el-card>
        </el-row>
        <!-- 采购耗材信息 end -->
    </el-dialog>
</div>

<script src="${request.contextPath}/statics/js/modules/purchase/storepurchaseapply_audit.js?_${.now?long}"></script>
<style>
    .el-dialog__header {  padding: 0px 0px 0px;}
    .el-dialog__body { padding: 15px 20px; }
</style>